package itheima.edu.info.arraylist.centual;

import java.util.ArrayList;
import java.util.Collection;
import java.util.function.Predicate;

public class CollectionText {
    public static void main(String[] args) {
        Collection<String> collection=new ArrayList<>();
        collection.add("李志宏");
        collection.add("bbb");
        collection.add("ccc");
        collection.add("严朝阳");
       // collection.removeIf(getStringPredicate());
        collection.remove("李志宏");
        boolean lzh = collection.contains("李志宏");
        System.out.println(lzh);
        int size = collection.size();
        System.out.println(size);
        System.out.println(collection);
    }

    private static Predicate<String> getStringPredicate() {
        return (s)->{return s.length()==3;};
    }
}
